package com.alex.designPattern.composite;

/**
 * 测试组合模式中的tree
 * @author alex
 *
 */
public class Client {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Tree tree = new Tree();
		tree.setText("tree");
		
		Leaf leaf1 = new Leaf();
		leaf1.setText("leaf1");
		tree.addChild(leaf1);
		
		Tree childrenTree1 = new Tree();
		childrenTree1.setText("tree1");
		Leaf leaf1_1 = new Leaf();
		leaf1_1.setText("leaf1_1");
		childrenTree1.addChild(leaf1_1);
		tree.addChild(childrenTree1);
		
		tree.show();
	}

}
